﻿using Fee.FileAttachs;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Fee.Mapping.FileAttachs
{
    public class FileAttachMapping : IEntityTypeConfiguration<FileAttach>
    {
        public void Configure(EntityTypeBuilder<FileAttach> builder)
        {
            builder.ToTable("fee_fileAttach");

            builder.HasKey(_ => _.Id);
            builder.Property(_ => _.Id).ValueGeneratedOnAdd();

            builder.Property(_ => _.CreateTime).ValueGeneratedOnAdd();
            builder.Property(_ => _.SystemPath).HasMaxLength(256);
            builder.Property(_ => _.Name).HasMaxLength(128);
            builder.HasOne(f => f.UploadUser);
        }
    }
}